package com.shinvent.common;

import java.io.BufferedWriter;
import java.io.FileWriter;
import java.util.Date;

public abstract class Logger {
	
	public static void logError(Exception e){
		StackTraceElement[] ste = e.getStackTrace();
		try{
		    FileWriter fstream = new FileWriter("errorLog.txt",true);
		    BufferedWriter out = new BufferedWriter(fstream);
		    out.write(new Date() + " " + e.toString() + "\n");
		    	for(int i = 0; i < ste.length; i++){
		    		out.write(ste[i].toString() + "\n");
		    	}
		    out.write("\n");
		    out.close();
		}catch (Exception ex){
		    ex.printStackTrace();
		}
		
	}
}
